#ifndef MATRIXSHEET_H
#define MATRIXSHEET_H

#include <QTableView>

class MatrixSheetPrivate;
class MatrixBase;
class MatrixSheet : public QTableView
{
    Q_OBJECT
public:
    explicit MatrixSheet(QWidget* parent = nullptr);
    ~MatrixSheet();

    void setMatrix(const QSharedPointer<MatrixBase>& matrix);
    QSharedPointer<MatrixBase> matrix() const;

    void setThumbnailsVisible(bool visible);
    bool isThumbnailsVisible() const;

    void setHorizontalHeaderData(const QVector<double>& data);
    QVector<double> horizontalHeaderData() const;

    void setVerticalHeaderData(const QVector<double>& data);
    QVector<double> verticalHeaderData() const;

protected:
    QSize sizeHint() const;
    void scrollContentsBy(int dx, int dy);

private slots:
    void onMatrixValueChanged(int row, int col, const QVariant& oldVal, const QVariant& newVal);

private:
    MatrixSheetPrivate* d_ptr;
};

#endif // MATRIXSHEET_H
